/**
 * Created by shenyinlin on 2018/6/24.
 */


import {Director} from "../Director.js";
import {Sprite} from "../base/Sprite.js";
import {DataStore} from "../base/DataStore.js";
//蜡烛基类
export class Pencil extends Sprite {


    constructor(image, top) {
        super(
            image, 0, 0,
            image.width,
            image.height,
            //刚好在右侧看不到的位置
            DataStore.getInstance().canvas.width,0,
            image.width,image.height
        )
        this.top = top;
    }


    draw(){
        this.x = this.x- Director.getInstance().moveSpeed;
        super.draw(this.img,0,0,this.width,this.height,
            this.x,
            this.y,this.width,this.height
        )
    }
}